<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ include file = "base.jsp" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
   <base href="<%=basePath%>">
	<link rel="stylesheet" href="<%=basePath%>css/bootstrap.css" />
	<link rel="stylesheet" href="<%=basePath%>js/bootstrap.min.js" />
	<link href="<%=basePath%>css/bootstrap-responsive.css" rel="stylesheet">
    <link href="<%=basePath%>js/google-code-prettify/prettify.css" rel="stylesheet">
	<link rel="shortcut icon" href="<%=basePath%>img/logo.jpg">
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="<%=basePath%>img/apple-touch-icon-144-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="<%=basePath%>img/apple-touch-icon-114-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="<%=basePath%>img/apple-touch-icon-72-precomposed.png">
    <link rel="apple-touch-icon-precomposed" href="<%=basePath%>img/apple-touch-icon-57-precomposed.png">
	
	<script type="text/javascript" src="<%=basePath%>js/jquery.js"></script>
    <script type="text/javascript" src="<%=basePath%>js/google-code-prettify/prettify.js"></script>
    <script type="text/javascript" src="<%=basePath%>js/bootstrap-transition.js"></script>
    <script type="text/javascript" src="<%=basePath%>js/bootstrap-alert.js"></script>
    <script type="text/javascript" src="<%=basePath%>js/bootstrap-modal.js"></script>
    <script type="text/javascript" src="<%=basePath%>js/bootstrap-dropdown.js"></script>
    <script type="text/javascript" src="<%=basePath%>js/bootstrap-scrollspy.js"></script>
    <script type="text/javascript" src="<%=basePath%>js/bootstrap-tab.js"></script>
    <script type="text/javascript" src="<%=basePath%>js/bootstrap-tooltip.js"></script>
    <script type="text/javascript" src="<%=basePath%>js/bootstrap-popover.js"></script>
    <script type="text/javascript" src="<%=basePath%>js/bootstrap-button.js"></script>
    <script type="text/javascript" src="<%=basePath%>js/bootstrap-collapse.js"></script>
    <script type="text/javascript" src="<%=basePath%>js/bootstrap-carousel.js"></script>
    <script type="text/javascript" src="<%=basePath%>js/bootstrap-typeahead.js"></script>
    <script type="text/javascript" src="<%=basePath%>js/bootstrap-affix.js"></script>
    <script type="text/javascript" src="<%=basePath%>js/application.js"></script>
    <style type="text/css">
		.navbar{
			background-color:#999999;
		
		}
		body{
			background-color:#F3F1EC;
		
		}
		#header{
			background:#F0F5F8;
			border: 1px solid #DADEE5;
			border-top-left-radius: 5px;
			border-top-right-radius: 5px;
			margin: 0;
			padding: 15px 30px;
		}
		.context{
			padding-bottom: 1em;
			position: relative;
			min-height:700px;
			float: left;
			background-color:#fff;
			border: 1px solid #DADEE5;
			border-top:none;
			margin:0px;
		
		}
		
		#left{
			padding-top:10px;
		}
		
		.getstart{
			background-color: #FFFAE7;
			border: 1px solid #CCCCCC;
			border-radius: 3px 3px 3px 3px;
			box-shadow: 0 0 2px rgba(0, 0, 0, 0.2);
			margin-top: 27px;
			padding: 12px;
			text-align: center;
			margin-left:67px;
			
		
		}
		.blank{
			
			text-align: center;
			width: 100%;
		
			
		}
		.input{
			height: 30px;
		}
    </style>
  </head>
  
  <body>
    <div id="container" >
    		<%@ include file="top.jsp"%>
		<div id="content">
			<div id="left" class="span3">
				<jsp:include page="lefttop.jsp">
					<jsp:param value="contact" name="tag"/>
				</jsp:include>
				<%@ include file="leftdown.jsp" %>
			
			</div>
			<div class="span9" id="down">
				<div id="header">
					<div id="word" style="margin-bottom:5px;"><b>编辑联系人</b></div>
					
				</div>
				<form class="form-horizontal  " action = "<%=basePath %>contact/edit.action?contactid=${contact.id}" method = "post" style = "margin-top:-18px">
				 	<input type="hidden" name="user.username" value="${session.nowUser.username}" />
				    <input type="hidden" name="contact.userid" value="${session.nowUser.id }"/>
					<input type="hidden" name="phonetype.userid" value="${session.nowUser.id }"/>
					<input type="hidden" name="info.userid" value="${session.nowUser.id }"/>
					<div style="padding:40px;margin-left:50px;">
						<b>姓名</b> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input name="contact.name" type="text"  class="span4" value="${contact.name }" id="name"/><span id="nameinfo" style="color:red;">*</span><br />
						<b>职务</b> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input name="contact.title" type="text" class="span4" value="${contact.title }"/><br />
						<b>公司</b> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input name="contact.company" type="text" class="span4" value="${contact.company} "/>
					</div>
					<div class="form" style=" margin-left:50px;padding:20px;" id="myform">
					
							<div id="phone" style="border-bottom: 1px solid #DADEE5;padding-bottom:10px;padding-left:15px;min-height:30px;padding-top:5px;">
								<b>电话</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" value="${phonetype.valuea }" class="span4"/>
								<hr/>
								<div id="add"></div>
								<a href="javascript:" id="aa" style="background-color:#999;width:100px;;"><i class="icon-plus-sign"></i>添加一个号码</a>
							</div>
					
							<b>QQZone</b> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="contact.qqzone" class="span4" style="margin-top:10px;"/><br />
							<b>微&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;博</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input type="text" name="contact.weibo" class="span4" style="margin-top:10px;"/><br />
							<div class="backinfo" style="border-bottom:1px solid #DADEE5;resize:none;">
								<small><b>背景资料</b></small><br />
								 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;
								 <textarea name="contact.note" id="" cols="30" rows="5" class="span4"style="resize:none;"></textarea>
							
							</div>
							<div class="form-actions alert alert-success" style = "border:none">
				            <button class="btn btn-primary" type="submit">保存此联系人</button>
				            <button class = "btn btn-info"><a href = "<%=basePath%>contact/toacontact?contactid=${contact.id}" style = "text-decoration:none;color:white">返回</a></button>
				         	</div>
				        </div> 	
				 </form> 
			</div>
			
		</div>	
	</div>
	<script type="text/javascript">
		
		$(document).ready(function(){
		
						
				$(".tip").tooltip();
				
				//name not null  validate
				
				
				$("#sub").click(function(){
					var v=$("#").html();
					if(v.trim()==null){
						$("#nameinfo").html("x该项必填");
						$("#name").focus();
						return;
					}
					$("#myform").submit();
					
				});
			  //添加电话
			
			$("#aa").live("click", function(){
				 
				    $("#add").append("<div><select style = 'display:inline;width:85px' name = 'phonetype'><option name='phonetype.keya' value='compnay'>公司</option><option name='phonetype.keya' value='work'>工作</option><option name='phonetype.keya'>手机</option><option name='phonetype.keya'>住宅</option></select><input type='text' name='phonetype.valuea' class='input-xlarge'/><span class='del-text' ><i class='icon-trash'></i></span></div>");
				});
			$("#ee").live("click", function(){
				 
				    $("#addemail").append("<div><input type='text' name='emailtype.valuea' class='input-xlarge'/><select style = 'display:inline;width:85px' name = 'emailtype'><option name='emailtype.keya'>公司</option><option name='emailtype.keya'>工作</option><option name='emailtype.keya'>手机</option><option name='emailtype.keya'>住宅</option></select><span class='del-text' ><i class='icon-trash'></i></span></div>");
				});
				
				
			$(".del-text").live("click",function(){ 
				$(this).parent().remove(); 
				i--; 
			}); 
					
		})
	</script>
  </body>
</html>
